using System;

namespace NewTcGui
{
	public class TcAboutDialog: wx.Dialog
	{
		private wx.Button okButton;
		private wx.StaticBitmap monoBitmap;
		private wx.StaticBitmap wxBitmap;
		private wx.StaticText appName;
		private wx.StaticText author;
		private wx.StaticText lyric;
		
		public TcAboutDialog(wx.Window parent):
			base(parent, wx.Window.wxID_ANY, "About", wx.Window.wxDefaultPosition, 
			     wx.Window.wxDefaultSize)
		{
			CreateControls();
			DoLayout();
		}
		
		private void CreateControls()
		{
			okButton = new wx.Button(this, wx.Window.wxID_OK, "&OK");
			okButton.SetDefault();
			
			wx.Image img = new wx.Image(TcGuiApp.GetBytesFromAssembly("mono.png", "Resources"), 
			                            wx.BitmapType.wxBITMAP_TYPE_PNG);
			img = img.Rotate90(false);
			monoBitmap = new wx.StaticBitmap(this, new wx.Bitmap(img));
			
			img = new wx.Image(TcGuiApp.GetBytesFromAssembly("wx.gif", "Resources"),
			                   wx.BitmapType.wxBITMAP_TYPE_GIF);
			img = img.Rotate90(false);
			wxBitmap = new wx.StaticBitmap(this, new wx.Bitmap(img));
			
			appName = new wx.StaticText(this, -1, "TrueCrypt Mounting \nGUI", 
			                            wx.Window.wxDefaultPosition, wx.Window.wxDefaultSize,
			                            wx.Alignment.wxALIGN_CENTER);
			appName.Font = new wx.Font(15, wx.FontFamily.wxNORMAL, wx.FontStyle.wxNORMAL,
			                           wx.FontWeight.wxBOLD);
			
			author = new wx.StaticText(this, "Jacek Trubłajewicz <gothic@os.pl>");			
			
			lyric = new wx.StaticText(this, -1, "\"I want her fire, her burning fire, \nher dark caress, her red hot kiss\n\nI want desire, her roaring fire, \nfrom milk white breast to raven tress \n\nI want her nights, morning light, \nher endless days, amazing greace\"", 
			                           wx.Window.wxDefaultPosition, wx.Window.wxDefaultSize,
			                           wx.Alignment.wxALIGN_CENTER);
			lyric.Font = new wx.Font(9, wx.FontFamily.wxNORMAL, wx.FontStyle.wxITALIC, 
			                         wx.FontWeight.wxNORMAL);
		}
		
		private void DoLayout()
		{
			wx.BoxSizer topSizer = new wx.BoxSizer(wx.Orientation.wxVERTICAL);
			{
				wx.BoxSizer boxSizer = new wx.BoxSizer(wx.Orientation.wxVERTICAL);
				{
					boxSizer.Add(20, 5, 0, wx.Alignment.wxALIGN_CENTER_HORIZONTAL, 0);
					
					wx.BoxSizer insideSizer = new wx.BoxSizer(wx.Orientation.wxHORIZONTAL);
					{
						wx.BoxSizer graphicSizer = new wx.BoxSizer(wx.Orientation.wxVERTICAL);
						{
							graphicSizer.Add(10, 20);
							graphicSizer.Add(monoBitmap, 0, 0, 0);
							graphicSizer.Add(20, 10);
							graphicSizer.Add(wxBitmap, 0, 0, 0);
							graphicSizer.Add(10, 20);
						}
						insideSizer.Add(graphicSizer, 0, wx.Stretch.wxEXPAND|
						                wx.Direction.wxALL, 5);
						
						wx.StaticLine line = new wx.StaticLine(this, -1, wx.Window.wxDefaultPosition,
						                                       wx.Window.wxDefaultSize, wx.StaticLine.wxLI_VERTICAL);
						insideSizer.Add(line, 0, wx.Stretch.wxEXPAND);
						
						wx.BoxSizer textSizer = new wx.BoxSizer(wx.Orientation.wxVERTICAL);
						{
							textSizer.Add(20, 20, 1, 0, 0);
							
							textSizer.Add(appName, 0, wx.Direction.wxLEFT|wx.Direction.wxRIGHT|
							              wx.Alignment.wxALIGN_CENTER_HORIZONTAL, 5);
							
							textSizer.Add(author, 0, wx.Direction.wxALL|
							              wx.Alignment.wxALIGN_CENTER_HORIZONTAL, 10);
							
							textSizer.Add(lyric, 0, wx.Direction.wxTOP|
							              wx.Alignment.wxALIGN_CENTER_HORIZONTAL, 15);
							
							textSizer.Add(20, 20, 2, 0, 0);
							
						}
						insideSizer.Add(textSizer, 1, wx.Stretch.wxEXPAND);
					}
					boxSizer.Add(insideSizer, 1, wx.Stretch.wxEXPAND);
					
					boxSizer.Add(okButton, 0, wx.Alignment.wxALIGN_CENTER_HORIZONTAL|
					             wx.Direction.wxTOP, 5);
				}
				topSizer.Add(boxSizer, 1, wx.Stretch.wxEXPAND|wx.Direction.wxALL, 10);
			}
			this.Sizer = topSizer;
			topSizer.Fit(this);
			topSizer.SetSizeHints(this);
			
			
		}
	}
}
